Refactoring Python Code: Profile Class